<template>
	<view class="yui-container">
		<view class="phone-box">
			<view class="phone-notice">
				<view class="phone-notice-title">积分赠送细则
				</view>
				<view class="phone-notice-container">
					1:买3000元以下手机，送一半积分，买3000元以上手机，送1500元积分。 2:手机建议到门店现场购买，现场验货、开票，国家三包，手机按官网价销售，购机不用办理任何话费套餐。
					<span class="tips">提货点查询</span> 
					3:赠送的积分到帐后，可在手机礼品商城全额任意兑换，无需加钱，手机换购商城的产品对标京东、天猫,1积分兑换1元商品。
				</view>
			</view>
		</view>
		<block v-for="(item, index) in productList">
		<view class="card">
			<view class="title-wrap">
				<view class="title">{{item.cate_name}}</view>
				<view class="title-right">
					<view class="more-text">查看更多</view>
					<image class="more-arrow" src=""></image>
					</image>
				</view>
			</view>
			<block v-for="(item1, index1) in item['data']">
			
			<view class="image-list" @tap="detail(item1.article_id)">
				<view class="item">
		
					<image src="/static/images/my/img1.png" class="item-image"></image>
					<view class="item-text">{{item1['title']}}</view>
				</view>
			</view>
			</block>
		</view>
		</block>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				cates: '',
				height: 0, //scroll-view高度
				top: 0,
				currentTab: 0, //预设当前项的值
				scrollViewId: "id_0",
				productList: [],
				skeletonShow: true,
				pageIndex: 1,
				total: '',
				category_id: 1,
				banner: [],
				smallproductlist: ''
			};
		},
		onLoad: function(options) {
			setTimeout(() => {
				uni.getSystemInfo({
					success: res => {
						let header = 92;
						let top = 0;
						//#ifdef H5
						top = 44;
						//#endif
						this.height = res.windowHeight - uni.upx2px(header);
						this.top = top + uni.upx2px(header);
					}
				});
			}, 50);
		},
		onShow() {

			this.tui.haslogin();
			if (this.tui.isLogin()) {
				this.init();
				
			}
		},
		methods: {
			// 点击标题切换当前页时改变样式
			init() {
				this.pageIndex = this.pageIndex + 1;
				let token = this.tui.getToken();
				let datas = {
					category_id: 1,
					sort: 'asc',
					page: this.pageIndex,
					limit: 10,
				};
				let result = this.tui.request('goods', 'post', datas, 1000, 1, '', 'goodsList');
				Promise.resolve(result).then((value) => {
					if (value.code == 200) {
						let newsdata = '';
						if (value.data.data) {
							this.productList=value.data.data
						}
						this.loadding = false;
					}
				
				
				})
			},
			detail(nid) {
				console.log(nid)
				uni.navigateTo({
					url: '/pageschild/news/newsDetail/anewsDetail?nid=' + nid
				});
			},
			
		},

	};
</script>

<style>
	page {
		background: #85a5fc;
	}
	.yui-container{
		/* margin:20rpx; */
	}
     .phone-box{
		 background: url(/static/images/common/phones.png);
		 background-size: 100%;
		 height: 800rpx;
		 padding-top: 340px;
	 }
	 .phone-notice{
		 padding:20rpx 80rpx 80rpx 80rpx;
		 font-size: 26rpx;
	 }
	 .phone-notice-title{
		 text-align: center;
		 font-size: 28rpx;
		 color:#fff;
		 margin-top:12rpx;
		 margin-bottom: 30rpx;
	 }
	 .phone-notice-container{
		 line-height: 44rpx;
	 }
	 .tips{
		 background:#628BFE;
		 color:#fff;border-radius: 20rpx;
		 padding:6rpx 16rpx;
	 }
	/* 左侧导航布局 start*/

	/* 隐藏scroll-view滚动条*/

	::-webkit-scrollbar {
		width: 0;
		height: 0;
		color: transparent;
	}

	.image-list {
		display: flex;
		padding-left: 13px;
		padding-top: 11px;
		overflow-x: auto
	}

	.item-text {
		font-size: 15px;
		color: #333;
		margin-top: 3px;
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
		width: 136px
	}

	.item-image {
		width: 143px;
		height: 88px;
		border-radius: 8px
	}

	.item{
		margin-right: 11px
	}

	.title-wrap{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 13px
	}

	.title{
		font-size: 17px;
		font-weight: 700;
		line-height: 17px
	}

	.title-right{
		display: flex;
		align-items: center
	}

	.more-text{
		margin-right: 5px;
		font-size: 15px;
		line-height: 15px;
		color: #888
	}

	.more-arrow{
		width: 8px;
		height: 8px
	}

	.list{
		padding: 11px;
		padding-top: 0;
		background: #f6f6f6
	}

	.card {
		margin-top: 20rpx;
		height: 192px;
		background: #fff;
		border-radius: 8px
	}

	.high-brokerage{
		height: 100%;
		background: #f6f6f6
	}
</style>
